package cn.edu.sspu.www.controller.home;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import cn.edu.sspu.www.contant.Constants;

/**
 * 主页相关操作
 * @author warm
 * @version 2019年08月01日
 */
@Controller
public class HomeController {
	
	/**
	 * 欢迎页面
	 * @param queryVo
	 * @return
	 */
	@RequestMapping("/welcome")
	public ModelAndView login(HttpServletRequest request) {

		ModelAndView view = new ModelAndView();		
		view.setViewName("home/welcome");
		return view;
	}
	

	/**
	 * 注销
	 * @param lessionUserInfo
	 * @return
	 */
	@RequestMapping("/logout")
	public ModelAndView logout(HttpServletRequest request) {
		
		ModelAndView view = new ModelAndView();		
		request.getSession().removeAttribute(Constants.SESSION_KEY);
		view.addObject("msg", "登录");
		view.setViewName("user/login");
		return view;
	}
}
